--蝰蛇警觉
local kuishejingjue = fk.CreateSkill {
    name = "mcdh_kuishejingjue"
}

local U = require "packages/utility/utility"
local lib = require "packages/mcdh/lib"

kuishejingjue:addEffect(fk.EventPhaseStart,{
    can_trigger = function(self, event, target, player, data)
        return player:hasSkill(kuishejingjue.name) and target.phase == Player.Start and target:inMyAttackRange(player)
                and player:getHandcardNum() < player.hp and player:canUseTo(Fk:cloneCard("slash"),target,{bypass_distances = true})
    end,
    on_cost = function (self, event, target, player, data)
        local room = player.room
        local use = U.askForUseVirtualCard(room,player,"slash",nil,self.name,"#mcdh_kuishejingjue_askfor",true,true,true,true,{must_targets = {target.id}},true)
        if use then
            self.cost_data = use
            return true
        end
    end,
    on_use = function (self, event, target, player, data)
        local room = player.room
        room:useCard(self.cost_data)
        player:drawCards(1,self.name)
    end
})

Fk:loadTranslationTable{
    ["mcdh_kuishejingjue"] = "蝰警",
    [":mcdh_kuishejingjue"] = "『蝰蛇警觉』<br>其他角色的准备阶段，若你在其攻击范围内且你的手牌数小于体力值，你可以视为对其使用一张无距离限制的【杀】，然后你摸一张牌。",
    ["#mcdh_kuishejingjue_askfor"] = "蝰蛇警觉：视为对当前回合角色使用一张无距离限制的【杀】"
}
return kuishejingjue